package com.grace.law.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.grace.law.service.EventTaskService;

@Controller
@RequestMapping("/casetask")
public class EventTaskController {
	@Autowired
	EventTaskService caseTaskService;

	
	
	@RequestMapping(value="/list",produces = "text/html;charset=UTF-8")
	@ResponseBody
	public String getCasesWithJson(HttpServletRequest request) throws Exception {
		ObjectMapper mapper = new ObjectMapper();
		return mapper.writeValueAsString(caseTaskService.getTaskList(request.getContextPath()));
	
	}
	
}
